import request from '@/utils/request'

// 查询质检任务明细列表
export function qualityMainTaskList(query) {
  return request({
    url: '/quality/qualityMainTask/list',
    method: 'get',
    params: query
  })
}

// 根据id查看物料质检任务信息
export function getTaskInfoById(data) {
  return request({
    url: '/quality/qualityMainTask/'+data,
    method: 'get',
  })
}

// 根据物料编号查询质检项明细
export function getQualityItemList(query) {
  return request({
    url: '/quality/productQualityItem/list',
    method: 'get',
    params: query
  })
}

// 根据质检任务NO查询质检任务明细列表
export function getTaskDetail(query) {
  return request({
    url: '/quality/qualityTaskDetail/list',
    method: 'get',
    params: query
  })
}


// 保存质检明细数据
export function saveDetailData(data) {
  return request({
    url: '/quality/qualityTaskDetail/batchSave',
    method: 'post',
	data
  })
}

// 根据质检任务NO查询未合格的质检任务
export function getTaskNgNum(query) {
  return request({
    url: '/quality/qualityMainTask/checkTaskNgNum',
    method: 'get',
    params: query
  })
}

// 完成质检任务
export function completeTask(data) {
  return request({
    url: '/quality/qualityMainTask/complete',
    method: 'put',
	data
  })
}

// 获取条码信息
export function getInfoByBarcode(barcode) {
  return request({
    url: '/inOutStock/stockCheck/getByBarcode/'+barcode,
    method: 'get',
  })
}